<?php
	require('../Model/mysql.php');
	require('../host_config.php');
	$mysql = new MySQL();
	$link = $mysql->connect($mysql_host, $mysql_user, $mysql_passwd, $mysql_db);
	$try = $mysql->real($_POST["try"]);
	//$try = $_POST["try"];
	//$try = mysql_real_escape_string($try);
	if ($try == "try") {
 		//$sql = "select all_name, address, pic5, current, max_number, tel from android";
		$sql = "SELECT `shopid`, `fullname`, `address`, `pic5`, `currentnumber`, `maxofnumber`, `tel`, `rank`, `commentnumber` FROM Shops";
 		$result = mysql_query($sql, $link);
 		while($e=mysql_fetch_assoc($result))
 			$output[]=$e;
 		print(json_encode($output));
 		mysql_close();
	}else {
		echo "<script language='javascript'>";
		echo "alert('You have no permission to read this page!');";
		echo "history.back();";
		echo "</script>";
		header("location:../login.php");
	}
?>

